package customerEnter.Frame.ehcache.major;

import java.io.InputStream;

import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;

/**
 * 實現緩存機制
 * 
 * 类名称：EcacheFactory 类描述： 创建人：dy 创建时间：2016-3-28 下午6:31:42
 * 
 */

public class EcacheFactory {
	/**
	 * 讀取緩存
	 */
	public static Cache EhcacheState() {
		InputStream in = EcacheFactory.class.getClassLoader().getResourceAsStream("ehcache.xml");
		CacheManager cm = CacheManager.create(in);
		Cache cache = cm.getCache("data-cache");
		return cache;
	}

}
